﻿using AutoMapper;
using CNav.Domain;
using CNav.Domain.Admin;
using CNav.Model;

namespace CNav.App_Start
{
    public class AutoMapping
    {
        internal static void Initialise()
        {
            Map<SessionUser, UserProfile>();
            Map<RegisterUserProfile, UserProfileModel>();
            Map<UpdateBusinessModel, Domain.Business>();
            Map<AddressModel, Address>();
            Map<UserProfile, UserProfileModel>();
            Map<UserProfileEx, UserProfileModel>();
            Map<Product, ProductModel>();
            Map<ComplaintType, ComplaintTypeModel>();
            Map<Domain.Business, BusinessModel>();
            Map<Consumer, ConsumerModel>();
            Map<RenderControl, RenderControlModel>();
            
        }

        private static void Map<TIn, TOut>()
        {
            Mapper.CreateMap<TIn, TOut>();
            Mapper.CreateMap<TOut, TIn>();
        }
    }
}